
\documentclass[a4paper]{ctexart}
\usepackage{hanzibox}
\usepackage{multicol}
\usepackage{l3draw}
\usepackage[hmargin=2cm]{geometry}

\title{2022-09-04}
\date{}

\input{bihua.tex}


\ExplSyntaxOn

\str_const:Nn \c_write_hanzi {大小多少}

\cs_set:Npn \hanziBihuaWithPinyin:n #1 {
  \hanzibox{#1} \showBiHua{#1}{*} \\
  \vspace{0.3cm}
  \int_step_inline:nn {15}
  {
  \hspace*{-0.40pt}
  \hanzibox*[hanzi=false]{#1}
  } \\
}


\int_new:N \g_my_op_one
\int_new:N \g_my_op_two
\int_new:N \g_my_op_three
\int_new:N \g_my_op_max
\int_new:N \g_my_op_min

\cs_set:Npn \randalgo:nn #1#2 {
  \int_set:Nn \g_my_op_one {\int_rand:nn{#1}{#2}}
  \int_gset:Nn \g_my_op_two {\int_rand:nn{#1}{#2}}
  \int_gset:Nn \g_my_op_three {\int_rand:nn{0}{1}}
  \int_compare:nNnTF {\int_use:N \g_my_op_three}>{0}
  {{\int_use:N \g_my_op_one} + {\int_use:N \g_my_op_two} =}
  {
    \int_compare:nNnTF {\int_use:N \g_my_op_one}>{\int_use:N \g_my_op_two}
    {
      {\int_gset:Nn \g_my_op_max {\int_use:N \g_my_op_one}}
      {\int_gset:Nn \g_my_op_min {\int_use:N \g_my_op_two}}
    }
    {
      {\int_gset:Nn \g_my_op_max {\int_use:N \g_my_op_two}}
      {\int_gset:Nn \g_my_op_min {\int_use:N \g_my_op_one}}
    }
    {{\int_use:N \g_my_op_max} - {\int_use:N \g_my_op_min} =}
  }
}
\ExplSyntaxOff


\begin{document}

\maketitle

\section{语文}
\label{sec:yuwen}

\subsection{写一写}
\label{sec:write}

%\loadBiHua{花有无会才吵当午汗知明和春冬}
\ExplSyntaxOn
\exp_args:Nx \loadBiHua {\c_write_hanzi}
\ExplSyntaxOff

\bihuaset{inner=2pt,frame=outertian,framestroke=red,iframestroke=red,width=0.8cm}
\hanziboxset{frametype=田,framecolor=red, pinyinline=true,pinyinf=\Large,charf=\kaishu\Huge,hanzi=true, tran=false}

\begin{center}
\begin{flushleft}

\ExplSyntaxOn
\str_map_function:NN \c_write_hanzi \hanziBihuaWithPinyin:n
\ExplSyntaxOff



\end{flushleft}
\end{center}



\section{数学}
\label{sec:math}

\subsection{20以内的加减法}
\label{sec:compute-1}

\ExplSyntaxOn
\begin{multicols}{2}
\begin{enumerate}
\item $\randalgo:nn{0}{20}$
\item $\randalgo:nn{0}{20}$
\item $\randalgo:nn{0}{20}$
\item $\randalgo:nn{0}{20}$
\item $\randalgo:nn{0}{20}$
\item $\randalgo:nn{0}{20}$
\item $\randalgo:nn{0}{20}$
\item $\randalgo:nn{0}{20}$
\item $\randalgo:nn{0}{20}$
\item $\randalgo:nn{0}{20}$
\end{enumerate}
\end{multicols}
\ExplSyntaxOff


\subsection{100以内的加减法}
\label{sec:compute-2}

\ExplSyntaxOn
\begin{multicols}{2}
\begin{enumerate}
\item $\randalgo:nn{0}{99}$
\item $\randalgo:nn{0}{99}$
\item $\randalgo:nn{0}{99}$
\item $\randalgo:nn{0}{99}$
\item $\randalgo:nn{0}{99}$
\item $\randalgo:nn{0}{99}$
\item $\randalgo:nn{0}{99}$
\item $\randalgo:nn{0}{99}$
\item $\randalgo:nn{0}{99}$
\item $\randalgo:nn{0}{99}$
\end{enumerate}
\end{multicols}
\ExplSyntaxOff



\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
